home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / GadUtil / Install_User < prev    next >
Text File  |  1997-10-05  |  5KB  |  173 lines

  1. ;--------------------------- Current version.revision ----------------------
  2. (set vernum (getversion "libs:gadutil.library"))
  3.  
  4. (set thisvernum (getversion "libs/gadutil.library"))
  5. (set thisver (/ thisvernum 65536))
  6. (set thisrev (- thisvernum (* thisver 65536)))
  7.  
  8. ;---------------------- All strings in the script --------------------------
  9.  
  10. (set #install-msg        "Installing GadUtil.library...")
  11.  
  12. (set #info-msg     (cat    "\n\nGadUtil installation script.\n"
  13.                         ("This script installs GadUtil %ld.%ld on your system.\n\n" thisver thisrev)
  14.                         "Read the docs for more information on the "
  15.                         "distribution and for use in commercial or "
  16.                         "other non-free programs.\n\n"
  17.                         "GadUtil is Copyright © 1994-1996 by\n"
  18.                         "P-O Yliniemi and Staffan Hämälä.\n"
  19.                         "All rights reserved."))
  20.  
  21. (set #useroptions-msg    "Select which user file(s) to install")
  22. (set #useroption1-msg    "The library file (replaces old version)")
  23. (set #useroption2-msg    "The debug version of the library file")
  24. (set #useroption3-msg    "User documentation")
  25. (set #useroption4-msg    "Aminet .readme file")
  26.  
  27. (set #maindir-msg  (cat    "Where do you wish to install GadUtil related\n"
  28.                         "files? The Installer will NOT create a new\n"
  29.                         "drawer at the selected location."))
  30.  
  31. (set #sellocfor-msg        "Please select a location for")
  32. (set #docdir-msg        ("%s all documentation" #sellocfor-msg))
  33.  
  34. (set #debuglib-msg (cat "\nYou have selected to install another version\n"
  35.                         "of GadUtil.library, that contains some extra\n"
  36.                         "code for debugging. This version can be used\n"
  37.                         "to trace problems while starting up applications\n"
  38.                         "that uses gadutil.library.\n\n"
  39.                         "To use the 'debug' version, rename the original\n"
  40.                         "library to something else, and rename the 'debug'\n"
  41.                         "version to 'gadutil.library'. Type 'avail flush'\n"
  42.                         "in Shell to remove the normal library from memory.\n"
  43.                         "You may have to reboot to remove the library from\n"
  44.                         "memory. Start the program and read...\n"))
  45.  
  46. (set #libinst-msg        "Installing gadutil.library.")
  47. (set #debuglibinst-msg    "Installing gadutil.library (debug version).")
  48.  
  49. ;-------------------- Installation script begins here ----------------------
  50. (if (exists "env:sys/def_doc.info")
  51.     (set def_doc_icon "env:sys/def_doc.info")
  52.     (set def_doc_icon "icons/def_doc.info")
  53. )
  54.  
  55. (if (exists "env:sys/def_guide.info")
  56.     (set def_guide_icon "env:sys/def_guide.info")
  57.     (set def_guide_icon "icons/def_doc.info")
  58. )
  59.  
  60. (set olduserlevel @user-level)
  61. (user 2)
  62. (transcript #install-msg)
  63. (message #info-msg)
  64. (user olduserlevel)
  65.  
  66. ;-------------------------- Get options for user install -------------------
  67. (set userinstall
  68.     (askoptions
  69.         (prompt #useroptions-msg)
  70.         (help    @askoptions-help)
  71.         (choices    #useroption1-msg
  72.                     #useroption2-msg
  73.                     #useroption3-msg
  74.                     #useroption4-msg
  75.         )
  76.         (default %1101)
  77.     )
  78. )
  79.  
  80. ;-------------------------- Create main directory --------------------------
  81. (if (IN userinstall 2 3)
  82.     (
  83.         (set destdir
  84.             (askdir
  85.                 (prompt #maindir-msg)
  86.                 (help @askdir-help)
  87.                 (default @default-dest)
  88.             )
  89.         )
  90.         (if (= @user-level 0) (set destdir (tackon destdir "GadUtil")))
  91.  
  92.         (if (<> (substr destdir (- (strlen destdir) 1)) ":")
  93.             (makedir destdir (infos))
  94.         )
  95.  
  96.         (set @default-dest destdir)
  97.  
  98.         (set docdir
  99.             (askdir
  100.                 (prompt #docdir-msg)
  101.                 (help @askdir-help)
  102.                 (newpath)
  103.                 (default (tackon destdir "Docs"))
  104.             )
  105.         )
  106.         (makedir docdir (infos))
  107.     )
  108. )
  109.  
  110. ;-------------------------- Do user installation ---------------------------
  111. (if (IN userinstall 0)
  112.        (copylib
  113.         (prompt #libinst-msg)
  114.            (help @copylib-help)
  115.            (source "libs/gadutil.library")
  116.            (dest "libs:")
  117.            (confirm)
  118.     )
  119. )
  120.  
  121. (if (IN userinstall 1)
  122.     (
  123.         (message #debuglib-msg)
  124.         (copylib
  125.             (prompt #debuglibinst-msg)
  126.             (help @copylib-help)
  127.             (source "libs/gadutil.library_dbg")
  128.             (dest "libs:")
  129.             (confirm)
  130.         )
  131.     )
  132. )
  133.  
  134. (if (IN userinstall 2)
  135.     (
  136.         (copyfiles (source "docs/GadUtil.Manual")
  137.             (dest docdir)
  138.         )
  139.         (copyfiles (source def_guide_icon)
  140.             (dest docdir) (newname "GadUtil.Manual.info")
  141.         )
  142.     )
  143. )
  144.  
  145. (if (IN userinstall 3)
  146.     (
  147.         (copyfiles (source "docs/GadUtil_usr.readme")
  148.             (dest docdir)
  149.         )
  150.         (copyfiles (source def_doc_icon)
  151.             (dest docdir) (newname "GadUtil_usr.readme.info")
  152.         )
  153.  
  154.         (copyfiles (source "docs/GadUtil_dev.readme")
  155.             (dest docdir)
  156.         )
  157.         (copyfiles (source def_doc_icon)
  158.             (dest docdir) (newname "GadUtil_dev.readme.info")
  159.         )
  160.  
  161.         (copyfiles (source "docs/GadUtil_html.readme")
  162.             (dest docdir)
  163.         )
  164.         (copyfiles (source def_doc_icon)
  165.             (dest docdir) (newname "GadUtil_html.readme.info")
  166.         )
  167.  
  168.     )
  169. )
  170.     
  171. ;--------------------------------- Done ------------------------------------
  172. (exit)
  173.